package evocarcassonne.tileseteditor.ui.javafx.controllers;


import evocarcassonne.tileseteditor.ui.javafx.managers.ConnectionsManager;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.layout.GridPane;

import java.net.URL;
import java.util.ResourceBundle;

public class TileController implements Initializable {

    @FXML
    static
    GridPane connGrid;

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        ConnectionsManager.init();
    }

    public void clearConns() {
        ObservableList<Node> children = connGrid.getChildren();
//        if (children != null)
            children.clear();
//        else
//            System.out.println("NULLLLLLL");
    }

    public void addConn(int card) {
        connGrid.add(ConnectionsManager.get(card), 0, 1);
    }
}
